package com.dingwei.superiordiary.adapter.easyViewHolder;

import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.dingwei.superiordiary.R;
import com.dingwei.superiordiary.app.MyApplication;
import com.dingwei.superiordiary.bean.CommodityDetailsBean;
import com.dingwei.superiordiary.bean.FindDetailsBean;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;
import com.lihao.baselibrary.base.BaseActivity;

import butterknife.Bind;
import butterknife.ButterKnife;

/**
 * Created by lihao on 2017/9/12.
 */

public class CommodityDetailsEvaluationItemHolder extends BaseViewHolder<CommodityDetailsBean.DataBean.CommentBean.SubBean> {

    @Bind(R.id.img_head)
    ImageView imgHead;
    @Bind(R.id.tv_user_name)
    TextView tvUserName;
    @Bind(R.id.tv_content)
    TextView tvContent;

    public CommodityDetailsEvaluationItemHolder(ViewGroup parent) {
        super(parent, R.layout.item_details_evaluation_item);
        ButterKnife.bind(this, itemView);

    }

    @Override
    public void setData(CommodityDetailsBean.DataBean.CommentBean.SubBean data) {
        super.setData(data);
        Glide.with(BaseActivity.context)
                .load(data.portrait)
                .apply(MyApplication.headOptions)
                .into(imgHead);
        tvUserName.setText(data.nickname);
        tvContent.setText(data.content);
    }
}
